package cn.com.customer.manager.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.xuexiang.xui.widget.flowlayout.BaseTagAdapter;

import cn.com.customer.manager.R;
import cn.com.customer.manager.bean.Tag;

/**
 *
 */
public class FlowTagAdapter extends BaseTagAdapter<Tag, TextView> {

    public FlowTagAdapter(Context context) {
        super(context);
    }

    @Override
    protected TextView newViewHolder(View convertView) {
        return (TextView) convertView.findViewById(R.id.tv_tag);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.adapter_item_tag;
    }

    @Override
    protected void convert(TextView textView, Tag item, int position) {
        textView.setText(item.getName());
//        if (item.getColor()!=""||item.getColor()!=null){
//            textView.setBackgroundColor(Color.parseColor(item.getColor()));
//        }
    }
}
